/**
 * @Description: 路由-静态路由
 * @Author: zhen
 * @Date: 2023-10-17
 */

import { RouteRecordRaw } from 'vue-router';
import { HOME_URL } from '@/constants';

/**
 * staticRouter(静态路由)
 */
export const staticRouter: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: HOME_URL
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('@/pages/home/index.vue'), // vite中不能省略index.vue，没解决找到方法
    meta: {
      title: 'home页面'
    }
  }
  // {
  //   path: '/layout',
  //   name: 'layout',
  //   component: () => import('@/layouts/index.vue'),
  //   // component: () => import("@/layouts/indexAsync.vue"),
  //   redirect: HOME_URL,
  //   children: []
  // }
];

/**
 * errorRouter(错误页面路由)
 */
export const errorRouter = [
  {
    path: '/403',
    name: '403',
    component: () => import('@/pages/error-message/403.vue'),
    meta: {
      title: '403页面'
    }
  },
  {
    path: '/404',
    name: '404',
    component: () => import('@/pages/error-message/404.vue'),
    meta: {
      title: '404页面'
    }
  },
  {
    path: '/500',
    name: '500',
    component: () => import('@/pages/error-message/500.vue'),
    meta: {
      title: '500页面'
    }
  },
  {
    path: '/:pathMatch(.*)*',
    component: () => import('@/pages/error-message/404.vue')
  }

  // 登陆中转
  // {
  //   path: '/idmRedirect',
  //   name: 'idmRedirect',
  //   component: () => import('@/layouts/idmRedirect.vue')
  // }
];
